<%@ page import="com.sxj.web.entity.User" %><%--
  Created by IntelliJ IDEA.
  User: User
  Date: 2024/3/9
  Time: 16:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>主页</title>
</head>
<body>
<!--
    当用户未登录时,访问主页显示下面的注册与登录
-->
<%
    User user = (User) session.getAttribute("user");
    if(user == null){
%>
<a href="">注册</a>
<a href="">登录</a>
<%
    } else{
%>
<!--
    等用户登录后访问时,显示下面的欢迎与注销
    xxx部分是当前登录者的名字
    点击注销之后退出登录
-->
欢迎您:<%=user.getUsername()%>
<a href="<%=request.getContextPath()%>/logout.code">注销</a>
<%
    }
%>
</body>
</html>
